import request from '@/config/axios'

// 大屏 VO
export interface BigscreenVO {
  id: number // ID
  name: string // 名称
  cover: string // 封面
  remark: string // 备注
  content: string // 内容
}

// 大屏 API
export const BigscreenApi = {
  // 查询大屏分页
  getBigscreenPage: async (params: any) => {
    return await request.get({ url: `/vmiot/bigscreen/page`, params })
  },

  // 查询大屏详情
  getBigscreen: async (id: number) => {
    return await request.get({ url: `/vmiot/bigscreen/get?id=` + id })
  },

  // 复制大屏
  copy: async (id: number) => {
    return await request.get({ url: `/vmiot/bigscreen/copy?id=` + id })
  },

  // 新增大屏
  createBigscreen: async (data: BigscreenVO) => {
    return await request.post({ url: `/vmiot/bigscreen/create`, data })
  },

  // 修改大屏
  updateBigscreen: async (data: BigscreenVO) => {
    return await request.put({ url: `/vmiot/bigscreen/update`, data })
  },

  // 分配租户
  changeTenant: async (data) => {
    return await request.put({ url: `/vmiot/bigscreen/changeTenant`, data })
  },

  // 删除大屏
  deleteBigscreen: async (id: number) => {
    return await request.delete({ url: `/vmiot/bigscreen/delete?id=` + id })
  },

  // 导出大屏 Excel
  exportBigscreen: async (params) => {
    return await request.download({ url: `/vmiot/bigscreen/export-excel`, params })
  },

  // 查询大屏详情-分享用
  getBigscreenByShare: async (id: number) => {
    return await request.get({ url: `/vmiot/bigscreen/getById?id=` + id })
  }
}
